package org.alex.netShop.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.alex.netShop.interfaces.Product;
import org.alex.netShop.interfaces.Products;






public class ProductsBean implements Products {
	
	private Map<String, Product> products = new HashMap<String, Product>();

	
	public Collection<Product> retrieve(){
		return products.values();
	}
	public Product retrieveProduct(String name){
		return products.get(name);
	}
	public Product save(Product product){
		return products.put(product.getName(), product);
	}
	public Product removeProduct(String product){
		return products.remove(product);
	}
}
